package com.skyrin.ssm.model;

import com.skyrin.ssm.util.ConstantUtil;

/**
 * @author skyrin
 * @create 2018-06-29 14:52
 */
public class CommonModel {
    // 0：请求成功，有数据返回；1：请求成功，无数据返回
    private int Code;
    // msg
    private String msg;
    // 可以单个对象或 List
    private Object object;

    public void setSuccess(){
        setCode(ConstantUtil.CODE_SUCCESS);
        setMsg(ConstantUtil.MSG_SUCCESS);
    }

    public void setFail() {
        setCode(ConstantUtil.CODE_FAIL);
        setMsg(ConstantUtil.MSG_FAIL);
    }

    public int getCode() {
        return Code;
    }

    public void setCode(int code) {
        Code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }
}
